// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init() 
const database = cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {
 
  return await  database.collection("tb_baoming").aggregate().lookup({
     from:"tb_match",
     localField:"matchid",
     foreignField:"_id",
     as:"list1"
   }).lookup({
     from:"tb_final",
     localField:"userid",
     foreignField:"userid",
     as:"list2"
   }).match({
     userid:event.userid
   }).end();
}